public class SellTicketTest
{
    public static void main(String[] args)
    {
        SellTickets s = new SellTickets(200);

        new Thread(s).start();
        new Thread(s).start();
        new Thread(s).start();

    }
}

class SellTickets implements Runnable
{
    private int numOfTickets;

    public SellTickets(int numOfTickets)
    {
        this.numOfTickets = numOfTickets;
    }

    @Override
    public void run()
    {
        int count = 0;
        while (count <= this.numOfTickets)
        {
            System.out.println(Thread.currentThread().getName() + " is selling tickets "  + count);
            count++;
        }
    }
}
